<template>
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
      </a-table>
    </div>
    <!-- table区域-end -->
</template>

<script>
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import { filterMultiDictText, initDictOptions } from '@/components/dict/JDictSelectUtil'

export default {
  name: "MyTaskNotifyList",
  props: ['procInstId'],
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      description: '我的提醒',
      disableMixinCreated: true,
      // 表头
        queryParam: {},
        columns: [
          {
            title: '序号',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '流程名称',
            align:"center",
            dataIndex: 'procName',
            width:120,
          },
		   {
            title: '任务名称',
            align:"center",
            dataIndex: 'taskName',
            width:100,
           },
          {
            title: '任务处理人',
            align:"center",
            dataIndex: 'taskAssignee',
            width:100,
            customRender: (text) => {
              if (!text) {
                return ''
              } else {
                return filterMultiDictText(this.dictOptions['username'], text + '')
              }
            }
          },
		   {
            title: '催办时间',
            align:"center",
            dataIndex: 'opTime',
            width:130,
           },
		   {
        title: '催办类型',
        align:"center",
        width:160,
        dataIndex: 'notifyType',
          customRender:function (text) {
            var srtArr = text.split(',');
            var value = "";
            if (srtArr.includes("1")) {
              value +=",系统消息"
            }
            if (srtArr.includes("2")) {
              value +=",邮件"
            }
            if (srtArr.includes("3")) {
              value +=",APP消息提醒"
            }
            return value.substring(1);
          }
        },
		   {
        title: '催办说明',
        align:"center",
        width:200,
        dataIndex: 'remarks',
        ellipsis: true,
        }
      ],
		url: {
      list: "/api/erpmng/act/process/extActTaskNotification/mylist",
    },
    dictOptions:{}
    }
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
    created() {
      //此处特殊，需要带参数查询数据，所以重新调用loadData()方法
      this.queryParam.procInstId = this.procInstId;
      console.log('this.procInstId',this.procInstId);
      this.loadData();
      //初始化字典配置 在自己页面定义
      this.initDictConfig();
    },
    methods: {
      initDictConfig() {
        initDictOptions('sys_user,realname,username').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'username', res.result)
          }
        })
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>